package ioDemand

import (
	"gitee.com/saxon134/workflow/db/chat"
	"gitee.com/saxon134/workflow/db/demand"
	"gitee.com/saxon134/workflow/db/job"
)

type ListRequest struct {
	Keyword string `json:"keyword" form:"keyword"`
	UserId  int64  `json:"userId" form:"userId"`
	Status  int    `json:"status" form:"status"`
	P       int    `json:"p" form:"p"`
	OnlyMe  bool   `json:"onlyMe" form:"onlyMe"`
}

type ListItem struct {
	*demand.TblDemand
	DoneJob int `json:"doneJob"` //已完成任务数量
	TodoJob int `json:"todoJob"` //未完成任务数量
}

type SaveRequest struct {
	*demand.TblDemand
	Jobs  []*job.TblJob `json:"jobs"`
	Chats []*chat.Chat  `json:"chats"`
}

type UpdateRequest struct {
	DemandId int64  `json:"demandId"`
	Key      string `json:"key"`
	Value    string `json:"value"`
}

type DetailResponse struct {
	*demand.TblDemand
	Jobs     []*job.TblJob `json:"jobs"`
	Disabled struct {
		Title    bool         `json:"title"`
		Detail   bool         `json:"detail"`
		Status   map[int]bool `json:"status"`
		P        bool         `json:"p"`
		Partners bool         `json:"partners"`
		Deadline bool         `json:"deadline"`
		Project  bool         `json:"project"`
	} `json:"disabled"`
}
